<?
require_once ('../../models/Users.php');
if(isset($_POST['id']))
{
	$results = Users::Delete($_POST['id']);
	if($results === true)
	{
		header("Location: index.php");
		die();
	}
}
$row = Users::Get($_REQUEST['id']);
?>


<!DOCTYPE html>
<html lang="en">
	<? include('../../inc/head.php'); ?>
	<body>
		<div>
			<? include('../../inc/nav.php'); ?>

			<div id="content">

			<? if(isset($response)): ?>
				<dl class="dl-horizontal error">
					<? foreach ($response as $key => $value) { ?>
						<dt><?=$key?></dt>
						<dd><?=$value?></dd>
					<? } ?>						
				</dl>
			<? endif; ?>

			<form method="post">
			<h2> Are you sure?</h2>

			<p> Would you like to delete <?=$row['FirstName']?> <?=$row['LastName'] ?></p>
			<input type="hiddden" name="id" value ="<?=$row['id'] ?>" />
			<input type="submit"  value="Delete" class="btn btn-primary"/>
			</form>

			</div>
			<? include('../../inc/footer.php'); ?>
		</div>
	</body>
</html>
